{extend name="public/base"}

{block name="title"}
合伙人团队
{/block}

{block name="style"}
{css href="/static/wechat/css/index.css" /}
{/block}

{block name="body"}
<div class="pageControl team">
    <div class="msui_nav msui_navTop">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">合伙人团队</h1>
    </div>
    <div class="weui-top">
        <div class="weui-cell team-header borderTop">
            <div class="weui-cell__bd">
                <p class="fs09">{$data.region.region_name}</p>
                <p class="fs07 top05">-{$data.level}级合伙人-</p>
            </div>
            <!--<div class="weui-cell__ft">-->
            <!--<a href="" class="cl-9999 fs075 team-header-link">查看详情&gt;</a>-->
            <!--</div>-->
        </div>
        <div class="menu_list" >
            <!--导航-->
            <ul class="coupons_ul">
                <li dataTab="1" class="fs08 msui_tabMenu-active">同级团队</li>
                <li dataTab="2" class="fs08 ">下级团队</li>
            </ul>
            <!--滑动的div-->
            <div class="slide"></div>
        </div>
        <div class="menu_page">
            <div dataPage="1" class="js-list">
                {volist name="data.partners" id="vo"}
                <a class="weui-cell" href="{:url('partner_info', ['id' => $vo['id']])}">
                    <div class="weui-label">
                        <img src="{$vo.headimgurl|get_img_url}" alt=""/>
                    </div>
                    <div class="weui-cell__bd">
                        <!--性别男加class为team-man,性别nv加class为team-woman,-->
                        <p class="{eq name='vo.sex' value='1'}team-man{/eq} {eq name='vo.sex' value='2'}team-woman{/eq}">{$vo.proposer}</p>
                        <p class="fs07 cl-9999">加入时间:<span>{$vo.audit_time|date="Y-m-d", ###}</span></p>
                    </div>
                    {eq name="vo.member_id" value="$data.member_id"}
                    <div class="weui-cell__ft team-me">
                        <span class="me">我</span>
                    </div>
                    {/eq}
                </a>
                {/volist}
            </div>
            <div dataPage="2"  class="js-list"  style="display: none;">
                {volist name="junior_data" id="vo"}
                <a class="weui-cell" href="{:url('partner_info', ['id' => $vo['id']])}">
                    <div class="weui-label">
                        <img src="{$vo.headimgurl|get_img_url}" alt=""/>
                    </div>
                    <div class="weui-cell__bd">
                        <!--性别男加class为team-man,性别nv加class为team-woman,-->
                        <p class="{eq name='vo.sex' value='1'}team-man{/eq} {eq name='vo.sex' value='2'}team-woman{/eq}">{$vo.proposer}</p>
                        <p class="fs07 cl-9999">加入时间:<span>{$vo.audit_time|date="Y-m-d", ###}</span></p>
                    </div>
                </a>
                {/volist}
            </div>
        </div>
    </div>
</div>
{/block}
{block name="javascript"}
<script>
    $(function () {
        /*tab下划线移动*/
        function tabLine(Tparent,target,line,speed){
            if(Tparent.length==0||target.length==0||line.length==0){
                return;
            }
            line.css('marginLeft',$('.msui_tabMenu-active').offset().left);
            target.on('click',function() {
                var left = $(this).offset().left - Tparent.offset().left;
                if (line.is(":animated")) {
                    line.stop(true,true);
                }
                line.animate({
                    marginLeft:left
                }, speed);
            })
        }
        tabLine($(".coupons_ul"),$(".coupons_ul li"),$(".slide"),100);

        $('.team .menu_list li').on('click',function(){
            var dataTab=$(this).attr('dataTab');
//	console.log($(this));
            var that=this;
            $('.team .menu_list li').each(function(){
                if($(this).hasClass('msui_tabMenu-active')){
                    $(this).removeClass('msui_tabMenu-active');
                }
                $(that).addClass('msui_tabMenu-active');
            })
            $('.team .js-list').each(function(){
                $(this).css('display','none');
                if($(this).attr('dataPage')==$(that).attr('dataTab')){
                    $(this).css('display','block');
                }
            })
        })
    });
</script>
{/block}